﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="neditor.index" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>wordpaster-neditor测试页面</title>
    <script type="text/javascript" charset="utf-8" src="neditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="neditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="neditor.service.js"></script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="i18n/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" src="third-party/browser-md5-file.min.js"></script>
    <script type="text/javascript" src="third-party/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="WordPaster/js/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/layer-3.1.1/layer.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.layer.js" charset="utf-8"></script>
	<script type="text/javascript" src="zyCapture/z.layer.js" charset="utf-8"></script>
    <script type="text/javascript" src="zyOffice/js/o.layer.js" charset="utf-8"></script>
</head>
<body>
<div>
    <h1>完整demo</h1>
    <script id="editor" type="text/plain" style="width:100%;height:300px;"></script>
</div>
<script type="text/javascript">
    var ue = UE.getEditor('editor');

    var pos = window.location.href.lastIndexOf("/");
    var api = [
        window.location.href.substr(0, pos + 1),
        "upload.aspx"
    ].join("");

    //wordpaster
    WordPaster.getInstance({
        //上传接口：http://www.ncmem.com/doc/view.aspx?id=d88b60a2b0204af1ba62fa66288203ed
        PostUrl: api,
        //为图片地址增加域名：http://www.ncmem.com/doc/view.aspx?id=704cd302ebd346b486adf39cf4553936
        ImageUrl: "",
        //设置文件字段名称：http://www.ncmem.com/doc/view.aspx?id=c3ad06c2ae31454cb418ceb2b8da7c45
        FileFieldName: "file",
        //提取图片地址：http://www.ncmem.com/doc/view.aspx?id=07e3f323d22d4571ad213441ab8530d1
        ImageMatch: '',
        event:{
			dataReady:function(e){
				//e.word,
				//e.imgs:tag1,tag2,tag3
				console.log(e.imgs)
			}
		}
    });
		
    //zyCapture
    zyCapture.getInstance({
        config: {
            PostUrl: api,
            FileFieldName: "file",
            Fields: { uname: "test" }
        }        
    });

    //zyoffice，
    //使用前请在服务端部署zyoffice，
    //http://www.ncmem.com/doc/view.aspx?id=82170058de824b5c86e2e666e5be319c
    zyOffice.getInstance({
        word:"http://localhost:13710/zyoffice/word/convert",
        wordExport:"http://localhost:13710/zyoffice/word/export",
        pdf:"http://localhost:13710/zyoffice/pdf/upload"
    });
</script>
</body>
</html>